<template>
  <div class="drawer-container">
    <div class="button rowFlex rowEnd"><el-button>新增</el-button></div>
    <el-table
      :data="tableData"
      style="width: 100%"
    >
      <el-table-column
        prop="image"
        label="图片"
      >
      </el-table-column>
      <el-table-column
        prop="status"
        label="状态"
      >
        <template slot-scope="{ row }">
          <el-image :src="row.image" class="image"></el-image>
        </template>
      </el-table-column>
      <el-table-column
        prop="jump"
        label="跳转短剧"
      >
      </el-table-column>
      <el-table-column
        label="创建人"
        prop="creator"
      >
      </el-table-column>
      <el-table-column
        label="创建时间"
        prop="create_time"
      >
      </el-table-column>
      <el-table-column
        label="操作"
      >
        <template slot-scope="{row}">
          <el-button type="text" size="medium">修改</el-button>
          <el-button type="text" size="medium">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <BiDrawer v-model="drawer.visible" :row="drawer.row" :drawer-title="drawer.title" :component="drawerComponent.addSwipper" drawer-size="45%" @ok="onSubmit"></BiDrawer>
  </div>
</template>

<script>
import BiDrawer from '@/components/BiDrawer'
import addSwipper from './addSwipper.vue'
export default {
  components: {
    BiDrawer
  },
  props: {
    drawerTitle: {
      type: String,
      default: ''
    },
    row: {
      type: Object,
      default: () => {}
    }
  },

  data() {
    return {
      formData: {
        mini_app_id: '',
        // 1文字，2图片
        type: 1,
        content: '',
        // 0 全部，1已支付，2未支付
        pay_status: 0
        // id:''
      },
      drawer: {
        visible: false,
        title: '新建收到消息回复',
        row: {}
      },
      drawerComponent: {
        addSwipper: addSwipper
      },
      tableData: []
    }
  },
  mounted() {

  },
  methods: {
    close() {
      this.$emit('cancel')
    },
    submit() {
      if (this.row?.id) {
        this.formData.id = row.id
      }
      this.$emit('ok', this.formData)
    },
    onSubmit() {

    }
  }
}
</script>
<style lang="scss" scoped>
  .button{
  margin-bottom: 20px;
  }
</style>